import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/pages/login'
import Home from '@/pages/back/Home'
import SellerRegister from '@/pages/back/SellerRegister'
import Brand from '@/pages/back/Brand'
import Content from '@/pages/back/Content'
import ContentCategory from '@/pages/back/Content_Category'
import Goods from '@/pages/back/Goods'
import ItemCat from '@/pages/back/Item_cat'
import SellerManager from '@/pages/back/SellerManager'
import Specification from '@/pages/back/Specification'
import TypeTemplate from '@/pages/back/Type_Template'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/home',
      name: '首页',
      component: Home,
      iconCls: 'el-icon-menu'
    },
    {
      path: '/',
      component: Home,
      iconCls: 'el-icon-star-off',
      name: '商家管理',
      children: [{
        path: '/sellerRegister',
        component: SellerRegister,
        name: '商家审核'
      },
      {
        path: '/sellerManager',
        component: SellerManager,
        name: '商家列表'
      }]
    },
    {
      path: '/',
      component: Home,
      iconCls: 'el-icon-location',
      name: '商品管理',
      children: [{
        path: '/Brand',
        component: Brand,
        name: '品牌管理'
      },
      {
        path: '/Specification',
        component: Specification,
        name: '规格管理'
      },
      {
        path: '/Type_Template',
        component: TypeTemplate,
        name: '模板管理'
      },
      {
        path: '/Item_cat',
        component: ItemCat,
        name: '分类管理'
      },
      {
        path: '/Goods',
        component: Goods,
        name: '商品审核'
      }
      ]
    },
    {
      path: '/',
      component: Home,
      iconCls: 'el-icon-goods',
      name: '广告管理',
      children: [{
        path: '/Content_Category',
        component: ContentCategory,
        name: '广告分类管理'
      },
      {
        path: '/Content',
        component: Content,
        name: '广告内容'
      }]
    },
    {
      path: '/',
      component: Home,
      iconCls: 'el-icon-setting',
      name: '代码生成',
      children: [{
        path: '/ElementTable',
        component: resolve => require(['../components/ElementTable'], resolve),
        name: '表格代码'
      }]
    },
    {
      path: '/',
      component: Home,
      iconCls: 'el-icon-message',
      name: 'API查看',
      children: [{
        path: '/StringShow',
        component: resolve => require(['../components/StringShow'], resolve),
        name: '字符串'
      }]
    }
  ]
})
